package com.tuyue.police.pojo;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * @Author: 王金海
 * @Description:
 * @Date: Created by Administrator on 2018/6/1.
 * @Modified By:
 */
@Entity
public class User {
    private long userId;
    private String userName;
    private String userPassword;
    private String userOpenId;
    private String userTag;
    private int type;
    private Timestamp creatTime;
    private String userAccountId;
    private Integer userPoliceType;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "user_id")
    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "user_name")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "user_password")
    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    @Basic
    @Column(name = "user_open_id")
    public String getUserOpenId() {
        return userOpenId;
    }

    public void setUserOpenId(String userOpenId) {
        this.userOpenId = userOpenId;
    }

    @Basic
    @Column(name = "user_tag")
    public String getUserTag() {
        return userTag;
    }

    public void setUserTag(String userTag) {
        this.userTag = userTag;
    }

    @Basic
    @Column(name = "type")
    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Basic
    @Column(name = "creat_time")
    public Timestamp getCreatTime() {
        return creatTime;
    }

    public void setCreatTime(Timestamp creatTime) {
        this.creatTime = creatTime;
    }

    @Basic
    @Column(name = "user_accountId")
    public String getUserAccountId() {
        return userAccountId;
    }

    public void setUserAccountId(String userAccountId) {
        this.userAccountId = userAccountId;
    }

    @Basic
    @Column(name = "user_police_type")
    public Integer getUserPoliceType() {
        return userPoliceType;
    }

    public void setUserPoliceType(Integer userPoliceType) {
        this.userPoliceType = userPoliceType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        if (userId != user.userId) return false;
        if (type != user.type) return false;
        if (userName != null ? !userName.equals(user.userName) : user.userName != null) return false;
        if (userPassword != null ? !userPassword.equals(user.userPassword) : user.userPassword != null) return false;
        if (userOpenId != null ? !userOpenId.equals(user.userOpenId) : user.userOpenId != null) return false;
        if (userTag != null ? !userTag.equals(user.userTag) : user.userTag != null) return false;
        if (creatTime != null ? !creatTime.equals(user.creatTime) : user.creatTime != null) return false;
        if (userAccountId != null ? !userAccountId.equals(user.userAccountId) : user.userAccountId != null)
            return false;
        if (userPoliceType != null ? !userPoliceType.equals(user.userPoliceType) : user.userPoliceType != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (userId ^ (userId >>> 32));
        result = 31 * result + (userName != null ? userName.hashCode() : 0);
        result = 31 * result + (userPassword != null ? userPassword.hashCode() : 0);
        result = 31 * result + (userOpenId != null ? userOpenId.hashCode() : 0);
        result = 31 * result + (userTag != null ? userTag.hashCode() : 0);
        result = 31 * result + type;
        result = 31 * result + (creatTime != null ? creatTime.hashCode() : 0);
        result = 31 * result + (userAccountId != null ? userAccountId.hashCode() : 0);
        result = 31 * result + (userPoliceType != null ? userPoliceType.hashCode() : 0);
        return result;
    }
}
